import request from '@/utils/request'

// 创建ERP 高职发货单
export function createHighValueInvoice(data) {
  return request({
    url: '/erp/high-value-invoice/create',
    method: 'post',
    data: data
  })
}

// 更新ERP 高职发货单
export function updateHighValueInvoice(data) {
  return request({
    url: '/erp/high-value-invoice/update',
    method: 'put',
    data: data
  })
}

// 删除ERP 高职发货单
export function deleteHighValueInvoice(id) {
  return request({
    url: '/erp/high-value-invoice/delete?id=' + id,
    method: 'delete'
  })
}

// 获得ERP 高职发货单
export function getHighValueInvoice(id) {
  return request({
    url: '/erp/high-value-invoice/get?id=' + id,
    method: 'get'
  })
}

// 获得ERP 高职发货单分页
export function getHighValueInvoicePage(params) {
  return request({
    url: '/erp/high-value-invoice/page',
    method: 'get',
    params
  })
}
// 导出ERP 高职发货单 Excel
export function exportHighValueInvoiceExcel(params) {
  return request({
    url: '/erp/high-value-invoice/export-excel',
    method: 'get',
    params,
    responseType: 'blob'
  })
}

// ==================== 子表（ERP 高职发货单单项） ====================
      // 获得ERP 高职发货单单项列表
    export function getHighValueInvoiceItemListByOutOrderId(outOrderId) {
      return request({
        url: '/erp/high-value-invoice/high-value-invoice-item/list-by-out-order-id?outOrderId=' + outOrderId,
        method: 'get'
      })
    }